<?

REQUIRE("../../protect/connect_jeu.php");






$QUERY="select sum(U.batiment_culture),B.batiment_ville

from sdbatiment AS B, ubatiment AS U
WHERE
B.batiment_idbatiment=U.batiment_id

GROUP BY B.batiment_ville";
$resultat=mysql_query($QUERY);


WHILE ($tmp=mysql_fetch_row($resultat)){
    IF ($tmp[0]){
        $query="UPDATE sdville SET ville_culture_total=ville_culture_total+$tmp[0] WHERE ville_id=$tmp[1]";
        $resultat2=mysql_query($query);
    }

}


MYSQL_CLOSE();



?>
